package org.jeecg.modules.exTenderFile.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import org.jeecg.modules.exTenderFile.entity.Chapter;
import org.jeecgframework.poi.excel.annotation.Excel;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Description: 招标文件目录树，封装树结构
 * @author: jeecg-boot
 */
@Data
public class ChapterTree implements Serializable {
    private static final long serialVersionUID = 1L;
    private String id;
    private String pid;
    private String name;
    /**
     * 类型编码
     */
    private String code;
    /**
     * 所属部门
     */
    private String sysOrgCode;
    /**
     * 是否有子节点
     */
    @Excel(name = "是否有子节点(1:有)", width = 15)
    private String hasChild;
    /**
     * 项目id
     */
    private String projectId;
    /**
     * 项目标段id
     */
    private String sectionId;
    /**
     * 目录类型(投标函、普通、工程量清单、工程量清单附件）
     */
    private String type;
    //排序
    private Integer sort;
    private List<ChapterTree> children;

    public ChapterTree(Chapter chapter) {
        this.id = chapter.getId();
        this.type = chapter.getType();
        this.name = chapter.getName();
        this.pid = chapter.getPid();
        this.sort = chapter.getSort();
        this.hasChild = chapter.getHasChild();
        if ("1".equals(chapter.getHasChild())) {
            this.children = new ArrayList<ChapterTree>();
        }
    }
}
